﻿using System;

namespace FreeSql
{
    /// <summary>
    /// IFreeSqlClient
    /// </summary>
    public interface IFreeSqlClient : IDisposable
    {
        /// <summary>
        /// 唯一KEY
        /// </summary>
        string DbKey { get; set; }

        /// <summary>
        /// IFreeSql
        /// </summary>
        IFreeSql FreeSql { get; set; }
    }

    /// <summary>
    /// FreeSqlClient
    /// </summary>
    public class FreeSqlClient : IFreeSqlClient
    {
        /// <summary>
        /// ctor
        /// </summary>
        public FreeSqlClient() { }

        /// <summary>
        /// DbKey
        /// </summary>
        public string DbKey { get; set; }

        /// <summary>
        /// IFreeSql
        /// </summary>
        public IFreeSql FreeSql { get; set; }

        /// <summary>
        /// Dispose
        /// </summary>
        public void Dispose()
        {
            FreeSql?.Dispose();
        }
    }
}
